#define _CRT_SECURE_NO_WARNINGS 1
#include "slist.h"
void testSListNode1()
{
	SListNode* plist;
	plist = NULL;
	SLTprint(plist);
	SLTPushBack(&plist, 1);
	SLTprint(plist);
	SLTPushBack(&plist, 2);
	SLTprint(plist);
	SLTPushBack(&plist, 3);
	SLTprint(plist);
	SLTPopBack(&plist);
	SLTprint(plist);
	SLTPopBack(&plist);
	SLTprint(plist);
	SLTPopBack(&plist);
	SLTprint(plist);
}

void testSListNode2()
{
	SListNode* plist;
	plist = NULL;
	SLTPushFront(&plist, 1);
	SLTprint(plist);
	SLTPushFront(&plist, 2);
	SLTprint(plist);
	SLTPushFront(&plist, 3);
	SLTprint(plist);
	SLTPushFront(&plist, 4);
	SLTprint(plist);
	SLTPopFront(&plist);
	SLTprint(plist);
	SLTPopFront(&plist);
	SLTprint(plist);
	SLTPopFront(&plist);
	SLTprint(plist);
	SLTPopFront(&plist);
	SLTprint(plist);

}

void testSListNode3()
{
	SListNode* plist;
	plist = NULL;

	SLTPushBack(&plist, 1);
	SLTprint(plist);
	SLTPushBack(&plist, 2);
	SLTprint(plist);
	SLTPushBack(&plist, 3);
	SLTprint(plist);
	SListNode* pos = SListFind(plist, 1);
	SListInsertAfter(pos, 4);
	SLTprint(plist);
	SListEraseAfter(pos);
	SLTprint(plist);
	SLTInsert(&plist, pos, 5);
	SLTprint(plist);
	pos = SListFind(plist, 5);

	SLTErase(&plist, pos);
	SLTprint(plist);

	SLTDestroy(&plist);


	//void SListEraseAfter(SListNode * pos);

	//printf("%p %d %p\n", ret, ret->date, ret->next);
	//printf("%d \n", ret->next->date);


	/*SLTPopFront(&plist);
	SLTprint(plist);
	SLTPopFront(&plist);
	SLTprint(plist);
	SLTPopFront(&plist);
	SLTprint(plist);*/


}

testSListNode4()
{
	SListNode* plist;
	plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	//SLTprint(plist);

	SLTDestroy(&plist);


}
int main()
{
	//testSListNode1();
	//testSListNode2();
	//testSListNode3();
	testSListNode4();

	return 0;
}